using System;
using System.Collections.Generic;
using System.Windows.Forms;
using Curchy.PERTToolbox.WinUI;
using Curchy.PERTToolbox.Service;
using System.Collections.Specialized;

namespace Curchy.PERTToolbox
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // Initialize application file association
            Service.InitializationToolbox.Instance.InitializeFileAssociation();

            // Start the Asynchronous Processes
            Service.Async.AsyncToolbox.StartAsyncProcess();

            StringDictionary cmd = CommandLineParser.Parse(args);
            
            // Run the main application
            if(cmd.ContainsKey("file"))
                Application.Run(new Master(cmd["file"]));
            else
                Application.Run(new Master());
        }
    }
}